import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import my from '@/views/my'
import Login from '@/views/Login'
import is404 from '@/views/is404'
import Find from '@/views/Find'
import Zixun from '@/views/Zixun'
import Home from '@/views/Home'
import City from '@/views/City'
import rentMap from '@/views/rentMap'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home'
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/layout/my',
        component: my
      },
      {
        path: '/layout/home',
        component: Home
      },
      {
        path: '/layout/find',
        component: Find
      },
      {
        path: '/layout/zixun',
        component: Zixun
      }
    ]
  },

  {
    path: '/login',
    component: Login
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/rentmap',
    component: rentMap
  },
  {
    path: '*',
    component: is404
  }
]

const router = new VueRouter({
  routes
})

export default router
